package com.mall.shopping.converter;


import com.mall.shopping.dal.entitys.Item;
import com.mall.shopping.dal.entitys.ItemDesc;
import com.mall.shopping.dto.ProductDetailDto;
import com.mall.shopping.dto.TestProductDetailDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

@Mapper(componentModel = "spring")
public interface ProductDetailConverter {

    @Mappings({
            @Mapping(source = "item.id", target = "productId"),
            @Mapping(source = "item.price", target = "salePrice"),
            @Mapping(source = "item.title", target = "productName"),
            @Mapping(source = "item.sellPoint", target = "subTitle"),
            @Mapping(source = "item.limitNum", target = "limitNum"),
            @Mapping(source = "item.imageBig", target = "productImageBig"),
            @Mapping(source = "itemDesc.itemDesc",target = "detail"),
           // @Mapping(source = "item.imageSmall", target = "productImageSmall")
    })
    ProductDetailDto ProductToProductDto(Item item, ItemDesc itemDesc);

}
